package io;

import com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter;
import com.sun.org.apache.xpath.internal.operations.Equals;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * 说明:
 *
 * @author: luohaowei
 * @date:2023/3/9
 **/
public class PwDemo2 {
    public static void main(String[] args) throws FileNotFoundException {
        FileOutputStream fos=new FileOutputStream("pw.txt");
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter bw=new BufferedWriter(osw);
        PrintWriter pw=new PrintWriter(bw,true);
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入,exit 退出");
        while(true){
            String line=scan.nextLine();
            if("exit".equals(line)){
                break;

            }
                pw.println(line);
                pw.close();

        }
        /*




        }
         */
    }
}
